// Random effects estimation of the 8 cities conjoint

cd $localdir

use Data/all_conjoint.dta, clear


// create indicators for levels of conjoint
foreach v of varlist educ hieduc invest gov workers local {
	levelsof `v'
	foreach i of numlist 1/`=`r(r)'-1' {
		gen `v'_ind_`i' = 0
		replace `v'_ind_`i' = 1 if `v' == `i'
	}
}

// save output for R
sort caseid table plan
save "Data/conjoint_for_r.dta", replace
